CLASSPATH = ../lib/antlr-3.3.jar:.
ANTLR = java -cp $(CLASSPATH) org.antlr.Tool
JAVAC = javac -cp $(CLASSPATH)

all : TryLexer.class BasicLexer.class

BasicLexer.class : BasicLexer.g
	$(ANTLR) BasicLexer.g
	$(JAVAC) BasicLexer.java

TryLexer.class : TryLexer.java BasicLexer.class
	$(JAVAC) $<

test:
	echo "123 Hello Word 321" | java -cp $(CLASSPATH) TryLexer


clean:
	rm -f *.class *.tokens BasicLexer.java
